<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for vue-unit-test-with-jest/src/views/OverView.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\index.html">All files</a> / <a href="index.html">vue-unit-test-with-jest/src/views</a> OverView.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/13</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/4</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/3</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/13</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div&gt;
    &lt;h1 class="title"&gt;this is overview&lt;/h1&gt;
    &lt;div class="example"&gt;
      &lt;h2 class="example_title"&gt;filter的单元测试例&lt;/h2&gt;
      &lt;el-input class="input" v-model="userInput" placeholder="输入长度大于7的内容，下方将显示过滤后内容"&gt;&lt;/el-input&gt;
      &lt;div v-show="toggleShow" class="text"&gt;{{userInput | formatText}}&lt;/div&gt;
      &lt;div v-show="!toggleShow" class="text"&gt;{{userInput}}&lt;/div&gt;
      &lt;app-button @click="changeShow"&gt;切换显示方式&lt;/app-button&gt;
    &lt;/div&gt;
    &lt;div class="example"&gt;
      &lt;h2 class="example_title"&gt;路由跳转的单元测试例&lt;/h2&gt;
      &lt;app-button size="lg" @click="goVIPs"&gt;跳转到VIP用户页面&lt;/app-button&gt;
    &lt;/div&gt;
    &lt;div class="example"&gt;
      &lt;h2 class="example_title"&gt;Axios的单元测试例&lt;/h2&gt;
      &lt;app-button size="lg" @click="getData"&gt;从后台接口获取数据&lt;/app-button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/template&gt;
&lt;script&gt;
export default {
  data () {
<span class="cstat-no" title="statement not covered" >    return {</span>
      userInput: '121',
      toggleShow: true,
      usersInfo: []
    }
  },
  filters: {
<span class="fstat-no" title="function not covered" >    formatText: function (value) {</span>
<span class="cstat-no" title="statement not covered" >      console.log(value)</span>
<span class="cstat-no" title="statement not covered" >      if (!value) return ''</span>
<span class="cstat-no" title="statement not covered" >      if (value.length &gt; 7) {</span>
<span class="cstat-no" title="statement not covered" >        let frontVal = value.slice(0, 2)</span>
<span class="cstat-no" title="statement not covered" >        let endVal = value.slice(value.length - 2, value.length)</span>
<span class="cstat-no" title="statement not covered" >        return frontVal + '...' + endVal</span>
      } else {
<span class="cstat-no" title="statement not covered" >        return value</span>
      }
    }
&nbsp;
  },
  methods: {
    changeShow () {
<span class="cstat-no" title="statement not covered" >      this.toggleShow = !this.toggleShow</span>
    },
    goVIPs () {
<span class="cstat-no" title="statement not covered" >      this.$router.push({</span>
        path: '/vips'
      })
    },
    getData () {
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >      this.$axios</span></span>
        .get('users/')
        .then(res =&gt; {
<span class="cstat-no" title="statement not covered" >          this.usersInfo = res.data</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >        })</span></span>
        .catch(err =&gt; console.log(err))
        .finally()
    }
  }
}
&lt;/script&gt;
&lt;style scoped&gt;
.title{
  margin-bottom: 20px;
}
.example{
  text-align: center;
  padding: 20px;
  border: 1px dashed red;
  margin-bottom: 50px;
}
.example_title{
  margin-bottom: 20px;
  color:blueviolet;
}
.input{
  width: 500px;
  margin-bottom: 20px;
}
.text{
  width: 500px;
  height: 30px;
  background-color:darkkhaki;
  margin: 0 auto;
  line-height: 30px;
  margin-bottom: 20px;
  font-weight: 700;
  color:deeppink;
}
&lt;/style&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri Mar 22 2019 13:56:06 GMT+0900 (GMT+09:00)
</div>
</div>
<script src="..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\sorter.js"></script>
</body>
</html>
